<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>

<div class="button_area" >
	<a class="submit">保存</a>
</div>
<s:form method="post" action="changepwd"   namespace="/user">
	<s:hidden name="user.userId" value="%{#session['wallet.session.user'].userId}"></s:hidden>

	<s:textfield label="姓名" name="user.userName" size="15"  value="%{#session['wallet.session.user'].userName}"
					required="true" readonly="true" ></s:textfield>
	<s:textfield label="登录帐户" readonly="true" name="user.loginId" size="15" value="%{#session['wallet.session.user'].loginId}"
					required="true" maxlength="20"></s:textfield>
	<s:password label="密码"  name="user.password" id="password" required="true" showPassword="true" size="17" maxlength="16"></s:password>
	<s:password label="密码确认"  name="againpassword" required="true" showPassword="true" size="17" maxlength="16"></s:password>
	</s:form>
<script type="text/javascript">
<!--

  $(document).ready(function(){
    $("form").validate({
    	errorLabelContainer: $("div.error"),
    	focusInvalid: true,
    	rules: {           //定义验证规则,其中属性名为表单的name属性  
			'user.password': {  
                required: true,  
                rangelength: [4,16],
                isPassword: true
            },  
            againpassword: {  
               	equalTo: "#password"  
            }
         }, 
         messages: {       //自定义验证消息  
         	'user.password': {  
                required: "密码是必需的<br>",  
				rangelength: $.format("密码要在{0}-{1}个字符之间<br>"),
				isPassword: "密码只能是字母或数字<br>"
             },  
            againpassword: {  
                 equalTo: "密码验证需要与密码一致<br>"  
             }
         }
    });
  });

//-->
</script>


